﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using System.Web.UI.HtmlControls;

public partial class Admin_Page_SearchServiceType : System.Web.UI.Page
{
    TaiKhoan TK;
    protected void Page_Load(object sender, EventArgs e)
    {
        TK = (TaiKhoan)Session["TaiKhoan"];
        if (TK == null || (TK != null && TK.MaNhomQuyen != 1))
        {

            Response.Redirect("~/Admin/Page_Login.aspx");
        }

        if (!IsPostBack)
        {
            ((HtmlGenericControl)Master.FindControl("hPageTitle")).InnerText = "Tìm kiếm Loại dịch vụ";
        }
    }

    private void TimKiem()
    {
        SqlDataSource1.FilterExpression = "1=1";
        if (txtTuKhoa.Text != "")
        {
            SqlDataSource1.FilterExpression += " AND ([Ten_EN] LIKE '%" + txtTuKhoa.Text + "%' OR [Ten_RU] LIKE '%" + txtTuKhoa.Text + "%')";
        }
    }


    protected void btnTim_Click(object sender, EventArgs e)
    {
        TimKiem();
    }
    protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        TimKiem();
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        TimKiem();
    }
}
